package com.zb.vo;

import com.zb.annotation.NumberLengthPattern;
import com.zb.annotation.NumberPattern;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * @Author WEN
 * @Date 2023/9/13 0013
 **/
@Data
@ApiModel("工单预警对象")
public class WorkWarningVo {
    @ApiModelProperty(value = "预警ID，新增不必传，修改必传")
    private Long id;

    @NotNull(message = "预警天数-最小值不能为空")
    @NumberLengthPattern(max = 6, message = "预警天数-最小值长度限制 6 个字符以内")
    @NumberPattern(regexp = "^[1-9]\\d{0,5}$", message = "预警天数-最小值只允许输入 >0，且总长度 <=6 的正整数", required = true)
    @ApiModelProperty(value = "预警天数-最小值", required = true, example = "2")
    private Integer min;

    @NotNull(message = "预警天数-最大值不能为空")
    @NumberLengthPattern(max = 6, message = "预警天数-最大值长度限制 6 个字符以内")
    @NumberPattern(regexp = "^[1-9]\\d{0,5}$", message = "预警天数-最大值只允许输入 >0，且总长度 <=6 的正整数", required = true)
    @ApiModelProperty(value = "预警天数-最大值", required = true, example = "4")
    private Integer max;

    @ApiModelProperty(value = "名称颜色")
    private String color;

    @ApiModelProperty(value = "权重", example = "1")
    private Integer weight;

    @NotNull(message = "预警状态不能为空")
    @ApiModelProperty(value = "预警状态：false-启用，true-禁用", required = true, example = "false")
    private Boolean status;
}
